<#--
/* $Id: autocompleterHRS.ftl $
 * Copia de autocompleter.ftl de struts2-dojo-plugin2.1.6
 * Preparado para multiple caracteres (incluyendo caracteres especiales)
 * Especialmente para solucionar el error de que 'initialValue' no
 * aceptaba caracteres especiales. 
 * 
 * Por: vschimpf, pgoette
 *
 * Nota: para que el autocompleter use este template se deben agregar
 * las siguientes propiedades:
 * 		template="autocompleterHRS.ftl"
 *		templateDir="WEB-INF/template"
 */
-->

<#-- controlheader.ftl" -->
	<#if parameters.label?if_exists != "">
		<#-- xhtml/controlheader.ftl" -->
			<#-- xhtml/controlheader-core.ftl" -->
				<#assign hasFieldErrors = parameters.name?? && fieldErrors?? && fieldErrors[parameters.name]??/>
				<#if hasFieldErrors>
				<#list fieldErrors[parameters.name] as error>
				<tr errorFor="${parameters.id}">
				<#if parameters.labelposition?default("") == 'top'>
				    <td align="left" valign="top" colspan="2"><#rt/>
				<#else>
				    <td align="center" valign="top" colspan="2"><#rt/>
				</#if>
				        <span class="errorMessage">${error?html}</span><#t/>
				    </td><#lt/>
				</tr>
				</#list>
				</#if>
				<#--
					if the label position is top,
					then give the label it's own row in the table
				-->
				<tr>
				<#if parameters.labelposition?default("") == 'top'>
				    <td align="left" valign="top" colspan="2"><#rt/>
				<#else>
				    <td class="tdLabel"><#rt/>
				</#if>
				<#if parameters.label??>
				    <label <#t/>
				<#if parameters.id??>
				        for="${parameters.id?html}" <#t/>
				</#if>
				<#if hasFieldErrors>
				        class="errorLabel"<#t/>
				<#else>
				        class="label"<#t/>
				</#if>
				    ><#t/>
				<#if parameters.required?default(false) && parameters.requiredposition?default("right") != 'right'>
				        <span class="required">*</span><#t/>
				</#if>
				${parameters.label?html}<#t/>
				<#if parameters.required?default(false) && parameters.requiredposition?default("right") == 'right'>
				 <span class="required">*</span><#t/>
				</#if>
				${parameters.labelseparator?default(":")?html}<#t/>
				
				<#-- xhtml/tooltip.ftl" -->
					<#if parameters.tooltip??><#t/>
					      <img
					      <#if parameters.tooltipIconPath??><#t/>
					      	src='<@s.url value="${parameters.tooltipIconPath}" includeParams="none" encode="false" />'
					      <#else><#t/>
					      	src='<@s.url value="/struts/tooltip.gif" includeParams="none" encode="false" />'
					      </#if><#t/>
					      <#if parameters.jsTooltipEnabled?default('false') == 'true'>
					          onmouseover="domTT_activate(this, event, 'content', '${parameters.tooltip}'<#t/>
					          <#if parameters.tooltipDelay??><#t/>
					          	<#t/>,'delay', '${parameters.tooltipDelay}'<#t/>
					          </#if><#t/>
					          <#t/>,'styleClass', '${parameters.tooltipCssClass?default("StrutsTTClassic")}'<#t/>
					          <#t/>)" />
					      <#else>
					      	title="${parameters.tooltip?html}"/>
					      	alt="${parameters.tooltip?html}"
					     </#if>
					</#if><#t/>
				<#-- xhtml/tooltip.ftl" -->
								
				</label><#t/>
				</#if>
				    </td><#lt/>
				<#-- add the extra row -->
				<#if parameters.labelposition?default("") == 'top'>
				</tr>
				<tr>
				</#if>
			<#-- xhtml/controlheader-core.ftl" -->
					
			    <td
			<#if parameters.align??>
			    align="${parameters.align?html}"<#t/>
			</#if>
			><#t/>
		<#-- xhtml/controlheader.ftl" -->
	</#if>
	<#if parameters.form?exists && parameters.form.validate?default(false) == true>
		<#-- can't mutate the data model in freemarker -->
	    <#if parameters.onblur?exists>
	        ${tag.addParameter('onblur', "validate(this);${parameters.onblur}")}
	    <#else>
	        ${tag.addParameter('onblur', "validate(this);")}
	    </#if>
	</#if>

<#-- controlheader.ftl" -->

<#if parameters.href?exists>
  <input dojoType="struts:ComboBox"<#rt/>
  dataUrl="${parameters.href}"<#rt/>
<#else>
  <select dojoType="struts:ComboBox"<#rt/>
</#if>
<#if parameters.id?if_exists != "">
 id="${parameters.id?html}"<#rt/>
</#if>
<#if parameters.cssClass?if_exists != "">
 class="${parameters.cssClass?html}"<#rt/>
</#if>
<#if parameters.cssStyle?if_exists != "">
 style="${parameters.cssStyle?html}"<#rt/>
</#if>
<#if parameters.forceValidOption?exists>
 forceValidOption="${parameters.forceValidOption?string?html}"<#rt/>
</#if>
<#if parameters.searchType?if_exists != "">
 searchType="${parameters.searchType?html}"<#rt/>
</#if>
<#if parameters.autoComplete?exists>
 autoComplete="${parameters.autoComplete?string?html}"<#rt/>
</#if>
<#if parameters.delay?exists>
 searchDelay="${parameters.delay?c}"<#rt/>
</#if>
<#if parameters.disabled?default(false)>
 disabled="disabled"<#rt/>
</#if>
<#if parameters.dropdownWidth?exists>
 dropdownWidth="${parameters.dropdownWidth?c}"<#rt/>
</#if>
<#if parameters.dropdownHeight?exists>
 dropdownHeight="${parameters.dropdownHeight?c}"<#rt/>
</#if>
<#if parameters.name?if_exists != "">
 name="${parameters.name?html}"<#rt/>
</#if>
<#if parameters.get("size")?exists>
 size="${parameters.get("size")?html}"<#rt/>
</#if>
<#if parameters.keyName?if_exists != "">
 keyName="${parameters.keyName?html}"<#rt/>
</#if>
<#if parameters.maxlength?exists>
 maxlength="${parameters.maxlength?string?html}"<#rt/>
</#if>
<#if parameters.nameValue?if_exists != "">
 initialValue="<@s.property value="parameters.nameValue" />"<#rt/>
</#if>
<#if parameters.nameKeyValue?if_exists != "">
 initialKey="${parameters.nameKeyValue}"<#rt/>
</#if>
<#if parameters.readonly?default(false)>
 readonly="readonly"<#rt/>
</#if>
<#if parameters.tabindex?exists>
 tabindex="${parameters.tabindex?html}"<#rt/>
</#if>
<#if parameters.formId?if_exists != "">
 formId="${parameters.formId?html}"<#rt/>
</#if>
<#if parameters.formFilter?if_exists != "">
 formFilter="${parameters.formFilter?html}"<#rt/>
</#if>
<#if parameters.listenTopics?if_exists != "">
 listenTopics="${parameters.listenTopics?html}"<#rt/>
</#if>
<#if parameters.notifyTopics?if_exists != "">
 notifyTopics="${parameters.notifyTopics?html}"<#rt/>
</#if>
<#if parameters.beforeNotifyTopics?if_exists != "">
  beforeNotifyTopics="${parameters.beforeNotifyTopics?html}"<#rt/>
</#if>
<#if parameters.afterNotifyTopics?if_exists != "">
  afterNotifyTopics="${parameters.afterNotifyTopics?html}"<#rt/>
</#if>
<#if parameters.errorNotifyTopics?if_exists != "">
  errorNotifyTopics="${parameters.errorNotifyTopics?html}"<#rt/>
</#if>
<#if parameters.valueNotifyTopics?if_exists != "">
  valueNotifyTopics="${parameters.valueNotifyTopics?html}"<#rt/>
</#if>
<#if parameters.indicator?if_exists != "">
 indicator="${parameters.indicator?html}"<#rt/>
</#if>
<#if parameters.loadOnTextChange?default(false)>
 loadOnType="${parameters.loadOnTextChange?string?html}"<#rt/>
</#if>
<#if parameters.loadMinimumCount?exists>
 loadMinimum="${parameters.loadMinimumCount?c}"<#rt/>
</#if>
<#if parameters.showDownArrow?exists>
 visibleDownArrow="${parameters.showDownArrow?string?html}"<#rt/>
</#if>
<#if parameters.iconPath?if_exists != "">
 buttonSrc="<@s.url value='${parameters.iconPath}' encode="false" includeParams='none'/>"<#rt/>
</#if>
<#if parameters.templateCssPath?if_exists != "">
 templateCssPath="<@s.url value='${parameters.templateCssPath}' encode="false" includeParams='none'/>"
</#if>
<#if parameters.dataFieldName?if_exists != "">
 dataFieldName="${parameters.dataFieldName?html}"
</#if>
<#if parameters.searchLimit?if_exists != "">
 searchLimit="${parameters.searchLimit?html}"
</#if>
<#if parameters.transport?if_exists != "">
  transport="${parameters.transport?html}"<#rt/>
</#if>
<#if parameters.preload?exists>
  preload="${parameters.preload?string?html}"<#rt/>
</#if>

<#-- simple/scripting-events.ftl -->
	<#if parameters.onclick??>
	 onclick="${parameters.onclick?html}"<#rt/>
	</#if>
	<#if parameters.ondblclick??>
	 ondblclick="${parameters.ondblclick?html}"<#rt/>
	</#if>
	<#if parameters.onmousedown??>
	 onmousedown="${parameters.onmousedown?html}"<#rt/>
	</#if>
	<#if parameters.onmouseup??>
	 onmouseup="${parameters.onmouseup?html}"<#rt/>
	</#if>
	<#if parameters.onmouseover??>
	 onmouseover="${parameters.onmouseover?html}"<#rt/>
	</#if>
	<#if parameters.onmousemove??>
	 onmousemove="${parameters.onmousemove?html}"<#rt/>
	</#if>
	<#if parameters.onmouseout??>
	 onmouseout="${parameters.onmouseout?html}"<#rt/>
	</#if>
	<#if parameters.onfocus??>
	 onfocus="${parameters.onfocus?html}"<#rt/>
	</#if>
	<#if parameters.onblur??>
	 onblur="${parameters.onblur?html}"<#rt/>
	</#if>
	<#if parameters.onkeypress??>
	 onkeypress="${parameters.onkeypress?html}"<#rt/>
	</#if>
	<#if parameters.onkeydown??>
	 onkeydown="${parameters.onkeydown?html}"<#rt/>
	</#if>
	<#if parameters.onkeyup??>
	 onkeyup="${parameters.onkeyup?html}"<#rt/>
	</#if>
	<#if parameters.onselect??>
	 onselect="${parameters.onselect?html}"<#rt/>
	</#if>
	<#if parameters.onchange??>
	 onchange="${parameters.onchange?html}"<#rt/>
	</#if>
<#-- simple/scripting-events.ftl -->

<#-- simple/common-attributes.ftl -->
	<#if parameters.accesskey??>
	 accesskey="${parameters.accesskey?html}" 
	</#if>
<#-- simple/common-attributes.ftl -->

<#if parameters.href?exists>
 />
<#else>
 >
</#if>
<#if parameters.list?exists>
	<#if (parameters.headerKey?exists && parameters.headerValue?exists)>
		<option value="${parameters.headerKey?html}">${parameters.headerValue?html}</option>
	</#if>
	<#if parameters.emptyOption?default(false)>
	    <option value=""></option>
	</#if>
    <@s.iterator value="parameters.list">
    <#if parameters.listKey?exists>
    	<#assign tmpListKey = stack.findString(parameters.listKey) />
    <#else>
    	<#assign tmpListKey = stack.findString('top') />
    </#if>
    <#if parameters.listValue?exists>
    	<#assign tmpListValue = stack.findString(parameters.listValue) />
    <#else>
    	<#assign tmpListValue = stack.findString('top') />
    </#if>
    <option value="${tmpListKey?html}"<#rt/>
        <#if (parameters.nameValue?exists && parameters.nameValue == tmpListKey)>
 selected="selected"<#rt/>
        </#if>
    ><#t/>
            ${tmpListValue?html}<#t/>
    </option><#lt/>
    </@s.iterator>
  </select>
</#if>
<#if parameters.label?if_exists != "">
	<#-- xhtml/controlfooter.ftl -->
		${parameters.after?if_exists}<#t/>
		    </td><#lt/>
		</tr>
	<#-- xhtml/controlfooter.ftl -->
</#if>
<#if parameters.pushId>
<script language="JavaScript" type="text/javascript">djConfig.searchIds.push("${parameters.id?html}");</script>
</#if>
